package com.zueb.mapper;

import com.zueb.pojo.Classes;
import com.zueb.pojo.Faculty;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface FacultyMapper {

    /**
     * 查询所有学院
     * @return
     */
    List<Faculty> getAllFaculty();

    /**
     * 添加学院
     * @param faculty
     */
    void addFaculty(Faculty faculty);

    /**
     * 根据学院名称查询学院
     * @param facultyName
     * @return
     */
    Faculty getFacultyByName(String facultyName);

    /**
     * 根据学院ID查询学院
     * @param facultyId
     * @return
     */
    Faculty getFacultyById(Integer facultyId);

    /**
     * 根据学院ID删除学院
     * @param facultyId
     */
    Integer deleteFacultyById(Integer facultyId);

    /**
     * 根据学院ID查找班级
     * @param facultyId
     * @return
     */
    List<Classes> getClassesByFaculty(@Param("facultyId") Integer facultyId);

    /**
     * 带页码查询学院
     * @param curPage
     * @param pageSize
     * @return
     */
    List<Faculty> getFacultyByPage(@Param("index")Integer index,
                             @Param("pageSize")Integer pageSize);

    /**
     * 查询学院数量
     * @return
     */
    int getFacultyCount();

    int editFaculty(@Param("facultyId")Integer facultyId,
                    @Param("facultyName")String facultyName);


    /**
     * 查询班级总数
     * @param facultyId
     * @return
     */
    int getClassesCount(int facultyId);

    /**
     * 带页码查询班级
     * @param index
     * @param pageSize
     * @param facultyId
     * @return
     */
    List<Classes> getClassesByPage(@Param("index")int index,
                                   @Param("pageSize")int pageSize,
                                   @Param("facultyId")int facultyId);

    /**
     * 添加班级
     * @param className
     * @param facultyId
     * @return
     */
    int addClasses(@Param("className")String className,
                   @Param("facultyId")int facultyId);

    int editClasses(@Param("classId")int classId,
                    @Param("className")String className,
                    @Param("facultyId")int facultyId);
}

